Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

115
Views
How to animate from length 0 -> 100 but remove animation from 100 -> 0

I have this timeline

<div class="timeline-wrapper">
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 100%"></div>
 </div>
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 100%"></div>
 </div>
 <div class="timeline-item">
   <div class="timeline-loaded" style="width: 83%"></div>
 </div>
</div>

So the last item goes up from to 84, 85 etc. but when i reset the timeline i want to have all the items style width: 0% but then it has the transition animation so u see that it goes to 0 but it needs to go to 0 instantly and smoothly fill from 0 to 100%.

Any help is welcome!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

By reading your question what I got is you need some progressbar. You can refer to this. https://www.w3schools.com/howto/howto_js_progressbar.asp

var i = 0;
function move() {
  if (i == 0) {
    i = 1;
    var elem = document.getElementById("myBar");
    var width = 1;
    var id = setInterval(frame, 10);
    function frame() {
      if (width >= 100) {
        clearInterval(id);
        i = 0;
      } else {
        width++;
        elem.style.width = width + "%";
      }
    }
  }
}

Basically it will modify width of your class. If you need more help on this please elaborate your requirement more with jsfiddle or any same.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!